
#include "MsgReceive.h"

#include "ServerUnWraper.h"
#include "Logger.h"
#include <iostream>
MsgReceive::MsgReceive(XmlRpc::XmlRpcServer *serv) : XmlRpcServerMethod("Server.MsgReceive",serv)
{
	unWraper = new ServerUnWraper();
}

MsgReceive::~MsgReceive() {
	delete unWraper;
	unWraper = NULL;
    //cleanUpRelations();
}

void MsgReceive::execute(XmlRpc::XmlRpcValue & params, XmlRpc::XmlRpcValue & result)
{
	std::string incomming;
	incomming = std::string(params[0]);
	if(unWraper == NULL) throw std::string("Brakuje UnWrapera");
	//std::cout<<"Incoming: "<<incomming<<std::endl;
	result = unWraper->serv(incomming);
	
}



void MsgReceive::setItsUnWraper(UnWraper* p_UnWraper) {
    unWraper = p_UnWraper;
}

UnWraper* MsgReceive::getItsUnWraper() 
{
	return unWraper;
}


/*********************************************************************
	File Path	: DefaultComponent\DefaultConfig\MsgReceive.cpp
*********************************************************************/
